/**
 * Copyright 2014-2016 com.eyaomall
 * All rights reserved.
 * 
 * @project
 * @author pro
 * @version 1.0
 * @date 2016-08-02
 */
package com.eyaomall.wxmall.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmall.model.po.GoodsTransport;
import com.eyaomall.wxmall.model.vo.TranspsortVO;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.support.DaoSupport;
/**
 * 产品运费
 * @author pro
 *
 */
@Repository
@NameSpace("goods_transport")
public class GoodsTransportDao extends DaoSupport<GoodsTransport> {

	/**
	 * 根据产品ID和城市ID获取运费模板
	 * @param goodsId
	 * @param cityId
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<TranspsortVO> listTransport(String goodsIds,Integer cityId){
		TranspsortVO vo = new TranspsortVO();
		vo.setGoodsIds(goodsIds);
		vo.setCityId(cityId);
		
		return (List<TranspsortVO>) super.list("queryTransport",vo);
	}
	
	/**
	 * 根据goodsId查询此商品是否有运费模板
	 */
	public GoodsTransport queryByGoodsId(int goodsId){
		GoodsTransport gt = new GoodsTransport();
		gt.setGoodsId(goodsId);
		return (GoodsTransport) super.query(gt);
	}
	
	/**
	 * 根据产品ID和城市ID获取运费模板
	 * @param goodsId
	 * @param cityId
	 * @return
	 */
	public TranspsortVO queryTransportByCity(Integer goodsId,Integer cityId){
		TranspsortVO vo = new TranspsortVO();
		vo.setGoodsId(goodsId);
		vo.setCityId(cityId);
		
		return (TranspsortVO) super.query("queryTransportByCity",vo);
	}
}
